Skip to content

[rtl872x] fixes System.ticks() #2600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2022
Merged

Conversation

technobly
Copy link
Member

Problem

  • System.ticks() returns 0 currently on P2 and TrackerM platforms.
  • System.ticksDelay() also doesn't work.
  • System.ticksPerMicrosecond() is wrong.

Solution

  • Ideally we'd have a hardware timer to use to hook up to System.ticks() like the rest of Gen 3 devices do, but the only one with a fast enough clock speed is currently being used for the RTC implementation and only has a 16-bit register anyway.
  • Instead of just disabling System.ticks() we have implemented a stop gap of tying it to the micros() counter when the system does not support a system tick hardware counter.
  • System.ticks() and micros() are essentially the same value on rtl872x based platforms now.
  • System.ticksDelay() works like delayMicroseconds()
  • System.ticksPerMicrosecond() returns 1

Steps to Test

  • Run TEST=wiring/no_fixture SYSTEM_08/SYSTEM_09

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@technobly technobly force-pushed the fix/sc-112287-p2-system-ticks branch from 659461b to 4b4c3fa Compare December 13, 2022 17:27
@technobly technobly merged commit 6d6d4e4 into develop Dec 13, 2022
@technobly technobly deleted the fix/sc-112287-p2-system-ticks branch December 13, 2022 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants